home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / gcp_24.exe / TERMSET.FR_ / TERMSET.FR
Text File  |  1994-04-27  |  14KB  |  567 lines

  1. VERSION 2.00
  2. Begin Form ConfigScrn 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Communication Settings"
  5.    ClientHeight    =   4785
  6.    ClientLeft      =   915
  7.    ClientTop       =   1260
  8.    ClientWidth     =   5160
  9.    ControlBox      =   0   'False
  10.    Height          =   5190
  11.    Left            =   855
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form3"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4785
  17.    ScaleWidth      =   5160
  18.    Top             =   915
  19.    Width           =   5280
  20.    Begin CheckBox NoModem 
  21.       Caption         =   "No modem - direct connection to host"
  22.       Height          =   255
  23.       Left            =   300
  24.       TabIndex        =   24
  25.       Top             =   4380
  26.       Width           =   3615
  27.    End
  28.    Begin ComboBox Combo2 
  29.       Height          =   300
  30.       Left            =   2100
  31.       TabIndex        =   21
  32.       Text            =   "Combo2"
  33.       Top             =   420
  34.       Width           =   1575
  35.    End
  36.    Begin ComboBox Combo1 
  37.       Height          =   300
  38.       Left            =   240
  39.       TabIndex        =   20
  40.       Text            =   "Combo1"
  41.       Top             =   420
  42.       Width           =   1455
  43.    End
  44.    Begin TextBox DialTone 
  45.       Height          =   285
  46.       Left            =   2100
  47.       TabIndex        =   17
  48.       Text            =   "DT"
  49.       Top             =   3900
  50.       Width           =   1575
  51.    End
  52.    Begin TextBox ModemIString 
  53.       Height          =   285
  54.       Left            =   2100
  55.       TabIndex        =   16
  56.       Text            =   "AT"
  57.       Top             =   3420
  58.       Width           =   1575
  59.    End
  60.    Begin CommandButton OKButton 
  61.       Caption         =   "OK"
  62.       Default         =   -1  'True
  63.       Height          =   375
  64.       Left            =   4020
  65.       TabIndex        =   0
  66.       Top             =   240
  67.       Width           =   915
  68.    End
  69.    Begin CommandButton CancelButton 
  70.       Cancel          =   -1  'True
  71.       Caption         =   "Cancel"
  72.       Height          =   375
  73.       Left            =   4020
  74.       TabIndex        =   1
  75.       Top             =   720
  76.       Width           =   915
  77.    End
  78.    Begin Frame Frame2 
  79.       Caption         =   "&Data Bits"
  80.       Height          =   735
  81.       Left            =   2100
  82.       TabIndex        =   2
  83.       Top             =   840
  84.       Width           =   1575
  85.       Begin OptionButton Data7 
  86.          Caption         =   "7"
  87.          Height          =   195
  88.          Left            =   180
  89.          TabIndex        =   3
  90.          Top             =   360
  91.          Width           =   375
  92.       End
  93.       Begin OptionButton Data8 
  94.          Caption         =   "8"
  95.          Height          =   195
  96.          Left            =   840
  97.          TabIndex        =   4
  98.          Top             =   360
  99.          Width           =   435
  100.       End
  101.    End
  102.    Begin Frame Frame3 
  103.       Caption         =   "&Stop Bits"
  104.       Height          =   735
  105.       Left            =   240
  106.       TabIndex        =   5
  107.       Top             =   840
  108.       Width           =   1455
  109.       Begin OptionButton Stop 
  110.          Caption         =   "2"
  111.          Height          =   195
  112.          Left            =   840
  113.          TabIndex        =   25
  114.          Top             =   360
  115.          Width           =   495
  116.       End
  117.       Begin OptionButton Stop1 
  118.          Caption         =   "1"
  119.          Height          =   195
  120.          Left            =   120
  121.          TabIndex        =   6
  122.          Top             =   360
  123.          Width           =   435
  124.       End
  125.       Begin OptionButton Stop2 
  126.          Caption         =   "2"
  127.          Height          =   195
  128.          Left            =   1560
  129.          TabIndex        =   7
  130.          Top             =   0
  131.          Width           =   495
  132.       End
  133.    End
  134.    Begin Frame Frame4 
  135.       Caption         =   "&Parity"
  136.       Height          =   1455
  137.       Left            =   2100
  138.       TabIndex        =   8
  139.       Top             =   1740
  140.       Width           =   1575
  141.       Begin OptionButton NoParity 
  142.          Caption         =   "None"
  143.          Height          =   195
  144.          Left            =   120
  145.          TabIndex        =   9
  146.          Top             =   360
  147.          Width           =   855
  148.       End
  149.       Begin OptionButton OddParity 
  150.          Caption         =   "Odd"
  151.          Height          =   195
  152.          Left            =   120
  153.          TabIndex        =   10
  154.          Top             =   660
  155.          Width           =   735
  156.       End
  157.       Begin OptionButton EvenParity 
  158.          Caption         =   "Even"
  159.          Height          =   195
  160.          Left            =   120
  161.          TabIndex        =   11
  162.          Top             =   960
  163.          Width           =   855
  164.       End
  165.    End
  166.    Begin Frame Frame5 
  167.       Caption         =   "&Flow Control"
  168.       Height          =   1455
  169.       Left            =   240
  170.       TabIndex        =   12
  171.       Top             =   1740
  172.       Width           =   1455
  173.       Begin OptionButton RTSFlow 
  174.          Caption         =   "Hardware"
  175.          Height          =   195
  176.          Left            =   120
  177.          TabIndex        =   18
  178.          Top             =   960
  179.          Width           =   1095
  180.       End
  181.       Begin OptionButton NoFlow 
  182.          Caption         =   "None"
  183.          Height          =   195
  184.          Left            =   120
  185.          TabIndex        =   14
  186.          Top             =   360
  187.          Width           =   855
  188.       End
  189.       Begin OptionButton XonFlow 
  190.          Caption         =   "Software"
  191.          Height          =   195
  192.          Left            =   120
  193.          TabIndex        =   13
  194.          Top             =   660
  195.          Width           =   1095
  196.       End
  197.    End
  198.    Begin Label Label4 
  199.       Caption         =   "Baud Rate"
  200.       Height          =   195
  201.       Left            =   2100
  202.       TabIndex        =   23
  203.       Top             =   180
  204.       Width           =   1515
  205.    End
  206.    Begin Label Label2 
  207.       Caption         =   "Port Selection"
  208.       Height          =   195
  209.       Left            =   240
  210.       TabIndex        =   22
  211.       Top             =   180
  212.       Width           =   1515
  213.    End
  214.    Begin Label Label3 
  215.       Alignment       =   1  'Right Justify
  216.       Caption         =   "Dial Attention Code"
  217.       Height          =   255
  218.       Left            =   300
  219.       TabIndex        =   19
  220.       Top             =   3900
  221.       Width           =   1695
  222.    End
  223.    Begin Label Label1 
  224.       Alignment       =   1  'Right Justify
  225.       Caption         =   "Modem Init String"
  226.       Height          =   255
  227.       Left            =   300
  228.       TabIndex        =   15
  229.       Top             =   3420
  230.       Width           =   1515
  231.    End
  232. End
  233. '***********  Communication CommSettings Configuration Form
  234.  
  235. 'Copyright (c) 1991, Crescent Software
  236.  
  237. DefInt A-Z
  238.  
  239. Dim Shared NewPort                 'temp config CommSettings
  240. Dim Shared NewBaud$, NewParity$
  241. Dim Shared NewData$, NewStop$
  242. Dim Shared NewShake
  243. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFileName As String) As Integer
  244. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  245. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  246.  
  247. '
  248. '--- 1200 baud option button
  249. '
  250. Sub Baud12_Click ()
  251.  
  252.     NewBaud$ = "1200"
  253.  
  254. End Sub
  255.  
  256. 'set new baud to 19200
  257. Sub Baud192_Click ()
  258.     NewBaud$ = "19200"
  259. End Sub
  260.  
  261. '
  262. '--- 2400 baud option button
  263. '
  264. Sub Baud24_Click ()
  265.  
  266.     NewBaud$ = "2400"
  267.  
  268. End Sub
  269.  
  270. '
  271. '--- 300 baud option button
  272. '
  273. Sub Baud3_Click ()
  274.  
  275.     NewBaud$ = "300"
  276.  
  277. End Sub
  278.  
  279. Sub Baud384_Click ()
  280.     NewBaud$ = "38400"
  281. End Sub
  282.  
  283. '
  284. '--- 4800 baud option button
  285. '
  286. Sub Baud48_Click ()
  287.  
  288.     NewBaud$ = "4800"
  289.  
  290. End Sub
  291.  
  292. Sub Baud56_Click ()
  293.     NewBaud$ = "56800"
  294. End Sub
  295.  
  296. '
  297. '--- 600 baud option button
  298. '
  299. Sub Baud6_Click ()
  300.  
  301.     NewBaud$ = "600"
  302.  
  303. End Sub
  304.  
  305. '
  306. '--- 9600 baud option button
  307. '
  308. Sub Baud96_Click ()
  309.  
  310.     NewBaud$ = "9600"
  311.  
  312. End Sub
  313.  
  314. '
  315. '--- Cancel button actions
  316. '
  317. Sub CancelButton_Click ()
  318.  
  319.     Unload ConfigScrn
  320.  
  321. End Sub
  322.  
  323. '
  324. '--- 7 data bits option button
  325. '
  326. Sub Data7_Click ()
  327.  
  328.     NewData$ = "7"
  329.  
  330. End Sub
  331.  
  332. '
  333. '--- 8 data bits option button
  334. '
  335. Sub Data8_Click ()
  336.  
  337.     NewData$ = "8"
  338.  
  339. End Sub
  340.  
  341. Sub DialTone_Change ()
  342.     If DialTone.Text = "" And ModemIString.Text = "" Then NoModem.Value = 1
  343. End Sub
  344.  
  345. Sub DialTone_KeyPress (KeyAscii As Integer)
  346.     NoModem.Value = 0
  347. End Sub
  348.  
  349. '
  350. '--- Echo off option button
  351. '
  352. Sub EchoOff_Click ()
  353.  
  354.     Echo = 0
  355.  
  356. End Sub
  357.  
  358. '
  359. '--- Echo on option button
  360. '
  361. Sub EchoOn_Click ()
  362.  
  363.     Echo = True
  364.  
  365. End Sub
  366.  
  367. '
  368. '--- Even parity option button
  369. '
  370. Sub EvenParity_Click ()
  371.  
  372.     NewParity$ = "E"
  373.     
  374. End Sub
  375.  
  376. '
  377. '--- Initialize and display configuration form
  378. '
  379. Sub Form_Load ()
  380.     Dim Tmp As String * 80
  381.  
  382.     '--- Get current port
  383.     Combo1.Text = Left$(frmMDI.ActiveForm.VT1.CommSettings, 4)
  384.     Combo1.AddItem "COM1"
  385.     Combo1.AddItem "COM2"
  386.     Combo1.AddItem "COM3"
  387.     Combo1.AddItem "COM4"
  388.     Combo1.AddItem "LPT1"
  389.     Combo1.AddItem "LPT2"
  390.     Combo1.AddItem "LPT3"
  391.  
  392.     '--- Get current baud
  393.     FirstComma = InStr(frmMDI.ActiveForm.VT1.CommSettings, ",")
  394.     Colon = InStr(frmMDI.ActiveForm.VT1.CommSettings, ":")
  395.     Baud$ = Mid$(frmMDI.ActiveForm.VT1.CommSettings, Colon + 1, (Len(frmMDI.ActiveForm.VT1.CommSettings) - 11))
  396.     Combo2.Text = Baud$
  397.     Combo2.AddItem "300"
  398.     Combo2.AddItem "600"
  399.     Combo2.AddItem "1200"
  400.     Combo2.AddItem "2400"
  401.     Combo2.AddItem "4800"
  402.     Combo2.AddItem "9600"
  403.     Combo2.AddItem "19200"
  404.     'Combo2.AddItem "38400"
  405.     'Combo2.AddItem "56000"
  406.     'Combo2.AddItem "115200"
  407.     'Combo2.AddItem "230400"
  408.  
  409.  
  410.     '--- Get current parity
  411.     Parity$ = Mid$(frmMDI.ActiveForm.VT1.CommSettings, FirstComma + 1, 1)
  412.     
  413.     Select Case UCase$(Parity$)             'select parity
  414.     Case "N"                                'set active parity
  415.         ConfigScrn.NoParity.Value = True    'option button
  416.     Case "E"
  417.         ConfigScrn.EvenParity.Value = True
  418.     Case "O"
  419.         ConfigScrn.OddParity.Value = True
  420.     End Select
  421.  
  422.     
  423.     '--- Get data bits
  424.     SecondComma = FirstComma + 2
  425.     DBits$ = Mid$(frmMDI.ActiveForm.VT1.CommSettings, SecondComma + 1, 1)
  426.     Select Case Val(DBits$)              'select data bits
  427.     Case 7                              'set active choice
  428.         ConfigScrn.Data7.Value = True       'option button
  429.     Case 8
  430.         ConfigScrn.Data8.Value = True
  431.     End Select
  432.  
  433.     '--- Get stop bits
  434.     ThirdComma = SecondComma + 2
  435.     SBits$ = Mid$(frmMDI.ActiveForm.VT1.CommSettings, ThirdComma + 1, 1)
  436.     Select Case Val(SBits$)                 'select stop bits
  437.     Case 1                                  'set active choice
  438.         ConfigScrn.Stop1.Value = True       'option button
  439.     Case 2
  440.         ConfigScrn.Stop2.Value = True
  441.     End Select
  442.  
  443.  
  444.     Select Case frmMDI.ActiveForm.VT1.FlowControl
  445.     Case 0                                  'set active choice
  446.         ConfigScrn.NoFlow.Value = True      'option button
  447.     Case 1
  448.         ConfigScrn.XonFlow.Value = True
  449.     Case 2
  450.         ConfigScrn.RTSFlow.Value = True
  451.     'Case 3
  452.     '   ConfigScrn.BothFlow.Value = True
  453.     End Select
  454.  
  455.     ' get Phone, PhonePrefix, ModemInitString for session
  456.     DialTone.Text = FState(frmMDI.ActiveForm.Tag).Dial
  457.     If DialTone.Text = "" Then DialTone.Text = "DT"
  458.     ModemIString.Text = FState(frmMDI.ActiveForm.Tag).ModemInitString
  459.     If ModemIString.Text = "" Then  'if empty, then disable but put in defaults
  460.         ModemIString.Text = "AT"
  461.         ModemIString.Enabled = False
  462.         DialTone.Enabled = False
  463.         NoModem.Value = 1
  464.     Else
  465.         NoModem.Value = 0
  466.         ModemIString.Enabled = True
  467.         DialTone.Enabled = True
  468.     End If
  469. End Sub
  470.  
  471. Sub ModemIString_Change ()
  472.     If ModemIString.Text = "" And DialTone.Text = "" Then NoModem.Value = 1
  473. End Sub
  474.  
  475. Sub ModemIString_KeyPress (KeyAscii As Integer)
  476.     NoModem.Value = 0
  477. End Sub
  478.  
  479. '
  480. '--- No handshaking option button
  481. '
  482. Sub NoFlow_Click ()
  483.  
  484.     NewShake = 0
  485.  
  486. End Sub
  487.  
  488. Sub NoModem_Click ()
  489.     If NoModem.Value = 1 Then
  490.         ModemIString.Enabled = False
  491.         DialTone.Enabled = False
  492.     Else
  493.         ModemIString.Enabled = True
  494.         DialTone.Enabled = True
  495.     End If
  496. End Sub
  497.  
  498. '
  499. '--- No parity option button
  500. '
  501. Sub NoParity_Click ()
  502.  
  503.     NewParity$ = "N"
  504.     
  505. End Sub
  506.  
  507. '
  508. '--- Odd parity option button
  509. '
  510. Sub OddParity_Click ()
  511.  
  512.     NewParity$ = "O"
  513.     
  514. End Sub
  515.  
  516. '
  517. '--- Ok button actions
  518. '
  519. Sub OkButton_Click ()
  520.     On Error Resume Next
  521.     If FIndex <> 0 Then
  522.         frmMDI.ActiveForm.VT1.CommSettings = Combo1.Text + ":" + Combo2.Text + "," + NewParity$ + "," + NewData$ + "," + NewStop$
  523.         frmMDI.ActiveForm.VT1.FlowControl = NewShake
  524.         If NoModem <> 0 Then ModemIString.Text = ""
  525.         FState(frmMDI.ActiveForm.Tag).ModemInitString = ModemIString.Text
  526.         FState(frmMDI.ActiveForm.Tag).Dial = DialTone.Text
  527.     End If
  528.     Unload ConfigScrn       'remove configuration form
  529. End Sub
  530.  
  531. '
  532. '--- RTS handshaking option button
  533. '
  534. Sub RTSFlow_Click ()
  535.  
  536.     NewShake = 2
  537.  
  538. End Sub
  539.  
  540. '
  541. '--- 2 stop bits option button
  542. '
  543. Sub Stop_Click ()
  544.  
  545.     NewStop$ = "2"
  546.  
  547. End Sub
  548.  
  549. '
  550. '--- 1 stop bit option button
  551. '
  552. Sub Stop1_Click ()
  553.  
  554.     NewStop$ = "1"
  555.  
  556. End Sub
  557.  
  558. '
  559. '--- XON handshaking option button
  560. '
  561. Sub XonFlow_Click ()
  562.  
  563.     NewShake = 1
  564.  
  565. End Sub
  566.  
  567.